#pragma once
#ifndef __UTIL_H
#define __UTIL_H

#include "log/log.h"

#define OFFSET_MEMBER(TYPE, MEMBER) (unsigned long)(&(((TYPE*)0)->MEMBER))
#define TARGET_FILENAME "AndroidManifest.xml"
#define TEMP_UNZIPPED_MANIFEST "..\\unzip_AndroidManifest.xml"

void initAllocedMemory(void* alloced, int size);
void freeMemory(void* alloced);

size_t decodeUTF8Length(uint8_t** str);
size_t decodeLength(uint16_t** str);

void convertToWCharString(wchar_t* dst, int dst_size, const char* src);
void convertToCharString(char* dst, int dst_size, const wchar_t* src);

#endif
